/*
 * Copyright (C) 2013 Daniel Wasilew <daniel.wasilew@codeminer.org>
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
package org.codeminer.parts.server.actions;

import org.codeminer.parts.application.ApplicationContext;
import org.codeminer.parts.server.users.User;

import java.io.File;

/**
 *
 * @author Daniel Wasilew <daniel.wasilew@codeminer.org>
 */
public final class ActionContext extends ApplicationContext {

    private User currentSessionUser;
    private final ApplicationContext applicationContext;

    public ActionContext(ApplicationContext applicationContext) {
        this.applicationContext = applicationContext;
    }

    public User getCurrentSessionUser() {
        return currentSessionUser;
    }

    public void setCurrentSessionUser(User currentSessionUser) {
        this.currentSessionUser = currentSessionUser;
    }

    @Override
    public void setTmpDir(File tmpDir) {
        applicationContext.setTmpDir(tmpDir);
    }

    @Override
    public void setLogDir(File logDir) {
        applicationContext.setLogDir(logDir);
    }

    @Override
    public void setLibraryFolder(File libraryDir) {
        applicationContext.setLibraryFolder(libraryDir);
    }

    @Override
    public void setDevelopment(boolean development) {
        applicationContext.setDevelopment(development);
    }

    @Override
    public void setDatabaseDir(File databaseDir) {
        applicationContext.setDatabaseDir(databaseDir);
    }

    @Override
    public void setConfigurationDir(File configurationDir) {
        applicationContext.setConfigurationDir(configurationDir);
    }

    @Override
    public void setBaseDir(File baseDir) {
        applicationContext.setBaseDir(baseDir);
    }

    @Override
    public void setArtworkFolder(File artworkFolder) {
        applicationContext.setArtworkFolder(artworkFolder);
    }

    @Override
    public boolean isDevelopment() {
        return applicationContext.isDevelopment();
    }

    @Override
    public File getTmpDir() {
        return applicationContext.getTmpDir();
    }

    @Override
    public File getLogDir() {
        return applicationContext.getLogDir();
    }

    @Override
    public File getLibraryFolder() {
        return applicationContext.getLibraryFolder();
    }

    @Override
    public File getDatabaseDir() {
        return applicationContext.getDatabaseDir();
    }

    @Override
    public File getConfigurationDir() {
        return applicationContext.getConfigurationDir();
    }

    @Override
    public File getBaseDir() {
        return applicationContext.getBaseDir();
    }

    @Override
    public File getArtworkFolder() {
        return applicationContext.getArtworkFolder();
    }

    @Override
    public File getHelpDir() {
        return applicationContext.getHelpDir();
    }

    @Override
    public <T> T getApplicationPart(Class<T> classDescriptor) {
        return applicationContext.getApplicationPart(classDescriptor);
    }
}
